/*
 * @Author:
 * @Date: 2017/4/17
 * @Last Modified by:
 * @Last Modified time:2017/4/17
 */
/*
 * @Author:
 * @Date: 2017/4/17
 * @Last Modified by:
 * @Last Modified time:2017/4/17
 */
import  axios from 'axios';
const URL = 'http://127.0.0.1:8360/admin/index';
export default {
  /**
   * 查找用户
   * @returns {*}
   */
  userList(){
    return axios.post( `${URL}/find_user` ).then( res => res.data );
  },
  /**
   * 删除用户
   * @param id 用户ID
   * @returns {*}
   */
  deleteUser( id ){
    return axios.post( `${URL}/delete_user`, { userID: id } ).then( res => res.data );
  },
  /**
   * 添加文章分类
   * @param params
   * @returns {*}
   */
  addArticleType( params ){
    return axios.post( `${URL}/add_article_type`, params ).then( res => res.data );
  },
  /**
   * 获取文章分类
   * @returns {*}
   */
  getArticleType(  ){
    return axios.post( `${URL}/get_article_type` ).then( res => res.data );
  },
  /**
   * 重置用户密码
   * @returns {*}
   */
  resetUserPassword(id){
    return axios.post( `${URL}/reset_user_pwd`,{ userID: id } ).then( res => res.data );
  }
}
